package com.highglass.videoplayer;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.LinearLayout;


import java.util.List;

/**
 * Created by wangjianqiang on 2016/10/25.
 */
public class ProgressView extends FrameLayout {
    private LinearLayout progress_view_2d;
    private LinearLayout progress_view_3d;

    public ProgressView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    public ProgressView(Context context) {
        super(context);
        init();
    }

    public ProgressView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        inflate(getContext(), R.layout.progress_view, this);
        progress_view_2d = (LinearLayout) findViewById(R.id.progress_view_2d);
        progress_view_3d = (LinearLayout) findViewById(R.id.progress_view_3d);
        progress_view_2d.setVisibility(GONE);
        progress_view_3d.setVisibility(GONE);
    }

    public void showProgress(boolean isIn3DMode) {
        if (isIn3DMode) {
            progress_view_3d.setVisibility(VISIBLE);
            progress_view_2d.setVisibility(GONE);
        } else {
            progress_view_3d.setVisibility(GONE);
            progress_view_2d.setVisibility(VISIBLE);
        }
    }

    public void hideProgress() {
        progress_view_3d.setVisibility(GONE);
        progress_view_2d.setVisibility(GONE);
    }
}
